<?php

use Biz\pockets\constInterface\BizWechatTagConfig;
use Doraemon\pockets\publicTrait\CheckConstants;
use Doraemon\tools\Curl;
use Doraemon\tools\HhzEnv;
/**
 * @deprecated
 */
class ToTagAction extends QueueActionPlugin implements BizWechatTagConfig
{
    use CheckConstants;

    public function main()
    {
        if (HhzEnv::isProduction()) {
            $totag = $this->getRequest()->getPost("totag");
            $content = $this->getRequest()->getPost("content");
            if (self::checkConstants(self::_CONSTANTS_TYPE_PREFIX, $totag)) {
                $param = [
                    'totag' => $totag,
                    'content' => $content,
                    'agentid' => self::WECHAT_BIZ_NOTICE_AGENT_ID,
                ];
                Curl::Request('post', self::WECHAT_NOTICE_URL, ['form_params' => $param]);
            }
        }
        $this->setSuccess();
    }
}